package com.lankystar.sos.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 用户认证表
 * @author SYX
 *
 */
@Entity
@Table(name="sos_userApprove")
public class UserApprove{


	/**
	 * id、身份证、身份证正面图、身份证反面图、用户类型（正常用户、医生、护士、红十字成员）、认证状态（未认证、认证通过、审核中、拒绝，原因）、认证时间、用户简介
	 */
	private int appId;
	private String idCard;
	private String idCardFront;
	private String idCardBack;
	private UserType userType;
	private AuthStatus authStatus;
	private Date authTime;
	private String userIntroduction;
	private User user;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getAppId() {
		return appId;
	}
	public void setAppId(int appId) {
		this.appId = appId;
	}
	public String getIdCard() {
		return idCard;
	}
	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	public String getIdCardFront() {
		return idCardFront;
	}
	public void setIdCardFront(String idCardFront) {
		this.idCardFront = idCardFront;
	}
	public String getIdCardBack() {
		return idCardBack;
	}
	public void setIdCardBack(String idCardBack) {
		this.idCardBack = idCardBack;
	}
	@ManyToOne
	@JoinColumn(name="userType_Id")
	public UserType getUserType() {
		return userType;
	}
	public void setUserType(UserType userType) {
		this.userType = userType;
	}
	@ManyToOne
	@JoinColumn(name="authStatus_Id")
	public AuthStatus getAuthStatus() {
		return authStatus;
	}
	public void setAuthStatus(AuthStatus authStatus) {
		this.authStatus = authStatus;
	}
	@Temporal(TemporalType.DATE)
	public Date getAuthTime() {
		return authTime;
	}
	public void setAuthTime(Date authTime) {
		this.authTime = authTime;
	}
	public String getUserIntroduction() {
		return userIntroduction;
	}
	public void setUserIntroduction(String userIntroduction) {
		this.userIntroduction = userIntroduction;
	}
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name = "user_id",unique=true)
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}
